class Login {
    constructor() {
        let phone_no_input = document.querySelector(".phone-put");
        let phone_pit = document.querySelector(".info-pit");
        phone_no_input.addEventListener("blur", function () {
            let phone_no_value = phone_no_input.value;
            if (!/^1[3-90]\d{9}$/.test(phone_no_value)) {
                phone_pit.style.display = "block";
                phone_pit.className += " error"
                return false;
            }
            phone_pit.className = "success";
        });
        this.passwordEvent();
        
    }
    passwordEvent() {
        let pass_input = document.querySelector(".password-put");
        let pass_pit = document.querySelector(".info-pit-pass"); 
        pass_input.addEventListener("blur", function () {
            let pass_value = pass_input.value;
            if (!/^[\s\S]{6,16}$/.test(pass_value)) {
                pass_pit.style.display = "block";
                pass_pit.innerHTML = "密码位数必须是6~18位之间";      
                pass_pit.className += " error";
                return false;
            }
            pass_pit.className = "success";
        });
    }

    
}
new Login();